package com.cskaoyan.service;

import com.cskaoyan.bean.MarketRegion;
import com.cskaoyan.bean.MarketRegionExample;
import com.cskaoyan.mapper.MarketRegionMapper;
import com.cskaoyan.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;

/**
 * @author stone
 * @date 2023/03/17 17:36
 */
public class RegionServiceImpl implements RegionService {
    SqlSessionFactory sqlSessionFactory = MyBatisUtil.getSqlSessionFactory();
    @Override
    public List<MarketRegion> getAll() {
        MarketRegionMapper regionMapper = sqlSessionFactory.openSession().getMapper(MarketRegionMapper.class);
        MarketRegionExample example = new MarketRegionExample();
        byte b = 4;
        example.or().andTypeNotEqualTo(b);
        return regionMapper.selectByExample(example);
    }
}
